package com.mondo.financialwallet.data;


import com.mondo.financialwallet.data.entity.BasisResponseEntity;
import com.mondo.financialwallet.data.entity.CheckMessageCodeResultEntity;
import com.mondo.financialwallet.data.entity.ClearProductDetailsEntity;
import com.mondo.financialwallet.data.entity.FeedbackResponseEntity;
import com.mondo.financialwallet.data.entity.FindEntity;
import com.mondo.financialwallet.data.entity.GoogleValidatorEntity;
import com.mondo.financialwallet.data.entity.HoldProductDetailsEntity;
import com.mondo.financialwallet.data.entity.HoldProductListEntity;
import com.mondo.financialwallet.data.entity.HoldProductProfitDataEntity;
import com.mondo.financialwallet.data.entity.MobilePrefixEntity;
import com.mondo.financialwallet.data.entity.MyTokenListEntity;
import com.mondo.financialwallet.data.entity.ProductDetailsEntity;
import com.mondo.financialwallet.data.entity.ProductListEntity;
import com.mondo.financialwallet.data.entity.ProductOrderListEntity;
import com.mondo.financialwallet.data.entity.SingleHoldProductProfitDataEntity;
import com.mondo.financialwallet.data.entity.TokenAddressEntity;
import com.mondo.financialwallet.data.entity.TokenTransactionRecordEntity;
import com.mondo.financialwallet.data.entity.UserAssetsEntity;
import com.mondo.financialwallet.data.entity.UserInfoEntity;
import com.mondo.financialwallet.data.entity.VersionUpdateEntity;
import com.mondo.financialwallet.data.entity.WalletAssetEntity;
import com.mondo.financialwallet.data.params.FeedbackParams;
import com.mondo.financialwallet.data.params.LoginParams;
import com.mondo.financialwallet.data.params.RegisterParams;
import com.mondo.financialwallet.data.params.ResetPasswordParams;
import com.mondo.financialwallet.data.params.SendMessageParams;
import com.mondo.financialwallet.data.params.TokenTransferParams;
import com.mondo.financialwallet.presentation.model.LoginUserInfoModel;

import java.io.File;

public class DataRepository implements DataSource {

    private static DataSource INSTANCE;

    public static DataSource get() {
        if (INSTANCE == null) {
            synchronized (DataRepository.class) {
                if (INSTANCE == null) {
                    INSTANCE = new DataRepository();
                }
            }
        }

        return INSTANCE;
    }

    private DataSource mRemoteDataSource;

    private DataRepository() {
        mRemoteDataSource = new RemoteDataSource();
    }

    @Override
    public void modifyAvatar(File avatar, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.modifyAvatar(avatar, callback);
    }

    @Override
    public void versionUpdate(DataCallback<VersionUpdateEntity> callback) {
        mRemoteDataSource.versionUpdate(callback);
    }

    @Override
    public void customerFeedback(FeedbackParams params, DataCallback<FeedbackResponseEntity> callback) {
        mRemoteDataSource.customerFeedback(params, callback);
    }

    @Override
    public void holdProductList(DataCallback<HoldProductListEntity> callback) {
        mRemoteDataSource.holdProductList(callback);
    }

    @Override
    public void holdProductDetails(String orderNumber, DataCallback<HoldProductDetailsEntity> callback) {
        mRemoteDataSource.holdProductDetails(orderNumber, callback);
    }

    @Override
    public void clearProductDetails(String orderNumber, DataCallback<ClearProductDetailsEntity> callback) {
        mRemoteDataSource.clearProductDetails(orderNumber, callback);
    }

    @Override
    public void holdProductProfitData(String orderNumber, DataCallback<HoldProductProfitDataEntity> callback) {
        mRemoteDataSource.holdProductProfitData(orderNumber, callback);
    }

    @Override
    public void findDAppList(DataCallback<FindEntity> callback) {
        mRemoteDataSource.findDAppList(callback);
    }

    @Override
    public void productOrderList(DataCallback<ProductOrderListEntity> callback) {
        mRemoteDataSource.productOrderList(callback);
    }

    @Override
    public void googleValidator(DataCallback<GoogleValidatorEntity> callback) {
        mRemoteDataSource.googleValidator(callback);
    }

    @Override
    public void bindGoogleValidator(String code, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.bindGoogleValidator(code, callback);
    }

    @Override
    public void clearProduct(String orderNumber, String code, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.clearProduct(orderNumber, code, callback);
    }

    @Override
    public void userInfo(DataCallback<UserInfoEntity> callback) {
        mRemoteDataSource.userInfo(callback);
    }

    @Override
    public void userAssets(DataCallback<UserAssetsEntity> callback) {
        mRemoteDataSource.userAssets(callback);
    }

    @Override
    public void myTokenList(DataCallback<MyTokenListEntity> callback) {
        mRemoteDataSource.myTokenList(callback);
    }

    @Override
    public void login(
            LoginParams params, DataCallback<LoginUserInfoModel> callback) {
        mRemoteDataSource.login(params, callback);
    }

    @Override
    public void register(
            RegisterParams params, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.register(params, callback);
    }

    @Override
    public void sendMessageCode(
            SendMessageParams params, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.sendMessageCode(params, callback);
    }

    @Override
    public void transfer(
            TokenTransferParams params,
            DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.transfer(params, callback);
    }

    @Override
    public void tokenTransactionRecord(
            int page, String tokenId, String income, DataCallback<TokenTransactionRecordEntity> callback) {
        mRemoteDataSource.tokenTransactionRecord(page, tokenId, income, callback);
    }

    @Override
    public void bindNewMobileNumber(String mobile, String code, String prefix, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.bindNewMobileNumber(mobile, code, prefix, callback);
    }

    @Override
    public void bindEmail(String email, String code, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.bindEmail(email, code, callback);
    }

    @Override
    public void alterLoginPassword(
            String oldPassword, String newPassword, String code, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.alterLoginPassword(oldPassword, newPassword, code, callback);
    }

    @Override
    public void singleHoldProductProfitData(String orderNumber, DataCallback<SingleHoldProductProfitDataEntity> callback) {
        mRemoteDataSource.singleHoldProductProfitData(orderNumber, callback);
    }

    @Override
    public void productList(DataCallback<ProductListEntity> callback) {
        mRemoteDataSource.productList(callback);
    }

    @Override
    public void walletAsset(DataCallback<WalletAssetEntity> callback) {
        mRemoteDataSource.walletAsset(callback);
    }

    @Override
    public void walletAssetAvailable(DataCallback<WalletAssetEntity> callback) {
        mRemoteDataSource.walletAssetAvailable(callback);
    }

    @Override
    public void tokenAddress(String tokenId, DataCallback<TokenAddressEntity> callback) {
        mRemoteDataSource.tokenAddress(tokenId, callback);
    }

    @Override
    public void sendMessageByUser(String mobileNumber, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.sendMessageByUser(mobileNumber, callback);
    }

    @Override
    public void checkMessageCodeResult(
            String mobileNumber, String code, DataCallback<CheckMessageCodeResultEntity> callback) {
        mRemoteDataSource.checkMessageCodeResult(mobileNumber, code, callback);
    }

    @Override
    public void alterPassword(
            ResetPasswordParams params, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.alterPassword(params, callback);
    }

    @Override
    public void generateFinancingOrders(String goodsId, String amount, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.generateFinancingOrders(goodsId, amount, callback);
    }

    @Override
    public void mobilePrefix(DataCallback<MobilePrefixEntity> callback) {
        mRemoteDataSource.mobilePrefix(callback);
    }

    @Override
    public void productDetails(String id, DataCallback<ProductDetailsEntity> callback) {
        mRemoteDataSource.productDetails(id, callback);
    }

    @Override
    public void alterNickname(String nickname, DataCallback<BasisResponseEntity> callback) {
        mRemoteDataSource.alterNickname(nickname, callback);
    }
}
